###############
##Python Util##
#############
snippet mk "Math" wA
$${1}$`!p
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
	snip.rv = ' '
else:
	snip.rv = ''
`$2
endsnippet

snippet dm "Math" wA
$$
${1:${VISUAL}}
$$ $0
endsnippet

snippet => "implies" i
\implies
endsnippet

snippet =< "implied by" i
\impliedby
endsnippet

snippet iff "iff" i
\iff
endsnippet


snippet // "Fraction" i	
\frac{$1}{$2}$0
endsnippet



snippet == "equals"
&= $1 \\\\
endsnippet



snippet td "to the ... power"  i
^{$1}$0
endsnippet

snippet rd "to the ... power" 
^{$1}$0
endsnippet

snippet __ "subscript" i
_{$1}$0
endsnippet


snippet ooo "\infty" 
\infty
endsnippet

snippet rij "mrij" i
(${1:x}_${2:n})_{${3:$2}\\in${4:\\N}}$0
endsnippet


snippet EE "exists" i
\exists 
endsnippet

snippet AA "forall" i 
\forall 
endsnippet

snippet mcal "mathcal" 
\mathcal{$1}$0
endsnippet

snippet lll "l"
\ell
endsnippet

snippet nabl "nabla" 
\nabla 
endsnippet

snippet xx "cross" i
\times 
endsnippet

snippet norm "norm"
\|$1\|$0
endsnippet


priority 100
snippet -> "to" i
\to 
endsnippet

priority 200
snippet <-> "leftrightarrow" 
\leftrightarrow
endsnippet

snippet !> "mapsto" 
\mapsto 
endsnippet


snippet \\\ "setminus" 
\setminus
endsnippet

snippet >> ">>" w
\gg
endsnippet

snippet << "<<" w
\ll
endsnippet

snippet set "set" w
\{$1\} $0
endsnippet

snippet || "mid" 
\mid 
endsnippet

snippet cc "subset" i
\subset 
endsnippet

snippet notin "not in " 
\not\in 
endsnippet

snippet inn "in" i 
\in 
endsnippet

snippet NN "n" i
\N
endsnippet

snippet Nn "cap" i
\cap 
endsnippet

snippet UU "cup" i
\cup 
endsnippet

snippet uuu "bigcup" i
\bigcup_{${1:i \in ${2: I}}} $0
endsnippet

snippet nnn "bigcap" i
\bigcap_{${1:i \in ${2: I}}} $0
endsnippet

snippet OO "emptyset" 
\O
endsnippet

snippet RR "real" 
\R
endsnippet

snippet QQ "Q" 
\Q
endsnippet

snippet ZZ "Z" 
\Z
endsnippet

snippet '(?<!i)sts' "text subscript" ir
_\text{$1} $0
endsnippet

snippet tt "text"	i
\text{$1}$0
endsnippet


snippet SI "SI" 
\SI{$1}{$2}
endsnippet

snippet \ov "overline" i
\overline{$1}$0
endsnippet

snippet ov\\ "overline" i
overline\
endsnippet

snippet vec "\vec{}" i
\vec{$1}$0
endsnippet

snippet ee "epsilon" i
\epsilon
endsnippet

snippet dd "delta" i
\delta
endsnippet

snippet DD "Delta" i
\Delta
endsnippet

snippet kksk "kksk" wi
`!p
snip.rv="{}".format(snip.fn)
`
endsnippet
# vim:ft=snippets
snippet "([0-1]?[^\s]\w*)/([0-9]?[^\s]\w*)" "frac" r
`!p
import script
snip.rv=script.frac(match.group(1),match.group(2))
`
endsnippet

snippet "([0-1]?[^\s]\w*)\\([0-9]?[^\s]\w*)\\" "frac" r
`!p
import script
snip.rv=script.replace(match.group(1),match.group(2))

`
endsnippet

snippet "({.+})/({.+})" "\frac" r
`!p
snip.rv="\\frac"+match.group(1)+match.group(2)
`
endsnippet
